<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="js/angular.js" ></script>
	</head>
	<body>
		<script>
			var app=angular.module("app",[]);
			app.controller('cont1',function($scope,$http){
				$http.get('a.php',{
					param:{a:12,b:11},
					responseType:'json'
				}).then(function(res){
					alert(res.data);
				},function(){
					alert("失败");
				})
			})
			
			/*方法二*/
			var app=angular.module("app",[]);
			app.controller('cont2',function($scope,$http){
				$http.get('a.php',{
					param:{a:12,b:12}
				}).success(function(res){
					alert(res);
				}).error(function(){
					
				})
			})
			
		</script>
	</body>
</html>
